class Solution(object):
    def stoneGameVI(self, aliceValues, bobValues):
        n = len(aliceValues)
        diff = [[aliceValues[i] + bobValues[i], i] for i in range(n)]
        diff.sort(reverse=True)
        alice = 0
        bob = 0
        for i in range(n):
            if i % 2 == 0:
                alice += aliceValues[diff[i][1]]
            else:
                bob += bobValues[diff[i][1]]
        if alice > bob:
            return 1
        if alice == bob:
            return 0
        else:
            return -1